{include file="header.tpl"}
<div data-role="page">	
	<div data-role="header" data-position="fixed" data-theme="b">
		<h1>{$siteTitle}</h1>
	</div>
	
	<div data-role="content">
		
		<form action="installment.html" method="post" class="validate">
			<div data-role="fieldcontain">
                <label for="name">Nazwa kredytu:</label>
                <input type="text" name="name" value="{$value->name}" id="name" class="required" data-mini="true" />
            </div>
            
            <div data-role="fieldcontain">
    			<label for="description">Opis kredytu:</label>
    			<textarea name="description" id="description">{$value->description}</textarea>
			</div>
			
			<div data-role="fieldcontain">
    			<label for="bank" class="select">Bank:</label>
    			<select name="bank" id="bank" data-mini="true">
    			   <option value="">Wybierz</option>
    			   {foreach from=$bank item=r}
    			   <option value="{$r->id}">{$r->name}</option>
    			   {/foreach}
    			</select>
			</div>
			
			<div data-role="fieldcontain">
    			<label for="months">Ilość rat:</label>
    			<input type="number" name="months" value="{$value->months}" id="months" class="required" data-mini="true" />
			</div>
			
			<div data-role="fieldcontain">
                <label for="cost">Kwota raty:</label>
                <input type="number" name="cost" value="{$value->cost}" id="cost" data-mini="true" />
            </div>
            
            <div data-role="fieldcontain">
    			<label for="term">Termin płatności:</label>
    			<input type="date" name="term" value="{$value->term}" id="term" data-mini="true" />
			</div>

            <div data-role="fieldcontain">
    			<label for="email">Przypomnienie E-mail:</label>
    			<select name="email" id="email" data-role="slider" data-mini="true">
    				<option value="0" {if $value->email}selected="selected"{/if}>nie</option>
    				<option value="1" {if $value->email}selected="selected"{/if}>tak</option>
    			</select>
			</div>
			
			<div data-role="fieldcontain">
    			<label for="sms">Przypomnienie SMS:</label>
    			<select name="sms" id="sms" data-role="slider" data-mini="true">
    				<option value="0" {if $value->sms}selected="selected"{/if}>nie</option>
    				<option value="1" {if $value->sms}selected="selected"{/if}>tak</option>
    			</select>
            </div>
        {if $smarty.get.task == 'edit'}  
			<fieldset class="ui-grid-b">
				<div class="ui-block-a"><a data-rel="back" data-role="button" data-theme="c">Anuluj</a></div>
				<div class="ui-block-b"><a href="#popupDialog" data-rel="popup" data-position-to="window" data-role="button" data-transition="pop">Usuń</a></div>
				<div class="ui-block-c">
				    <input type="hidden" name="edit" value="{$value->id}" />
				    <button type="submit" data-theme="b">Zapisz</button>
			    </div>	   
			</fieldset>
        {else}	
            <fieldset class="ui-grid-a">
                <div class="ui-block-a"><a data-rel="back" data-role="button" data-theme="c">Anuluj</a></div>
                <div class="ui-block-b">
                    <input type="hidden" name="new" />
                    <button type="submit" data-theme="b">Zapisz</button>
               </div>     
            </fieldset>
        {/if}   
		</form>
	</div>
	
        <div data-role="popup" id="popupDialog" data-overlay-theme="a" data-theme="c" style="max-width:400px;" class="ui-corner-all">
            <div data-role="header" data-theme="a" class="ui-corner-top">
                <h1>Delete Page?</h1>
            </div>
            <div data-role="content" data-theme="d" class="ui-corner-bottom ui-content">
                <h3 class="ui-title">Czy jesteś pewień, że chcesz skasować ?</h3>
                <p>This action cannot be undone.</p>
                <a href="#" data-role="button" data-inline="true" data-rel="back" data-theme="c">Nie</a>    
                <a href="#" data-role="button" data-inline="true" data-rel="back" data-transition="flow" data-theme="b">Tak</a>  
            </div>
        </div>
</div>		
{include file="footer.tpl"}